﻿<%@ Page Language="C#" MasterPageFile="~/Admin/SiteAdmin.Master" AutoEventWireup="true" CodeBehind="DanhSachTinTuc.aspx.cs" Inherits="DM.Web.Admin.QuanLyTinTuc.DanhSachTinTuc" Title="Công ty cổ phần Đường Man - Duong Malt JSC" MaintainScrollPositionOnPostback="true" %>
<%@ Import Namespace="DM.DAO" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1>Danh sách tin tức</h1>
<table width="100%">
    <tr>
        <td style="width: 20%"><b>Nhóm Tin</b></td>
        <td style="width: 30%"><asp:DropDownList ID="DropDownListLoaiTinCha" Width="80%" runat="server"  EnableViewState="true" AutoPostBack="True" OnSelectedIndexChanged="DropDownListLoaiTinCha_SelectedIndexChanged"></asp:DropDownList></td>
        <td style="width: 20%"><b>Loại Tin</b></td>
        <td style="width: 30%"><asp:DropDownList ID="DropDownListLoaiTin" Width="80%" runat="server" EnableViewState="true" AutoPostBack="True"></asp:DropDownList></td>
    </tr>
    <tr>
        <td style="width: 20%"><b>Ngôn ngữ</b></td>
        <td style="width: 30%"><asp:DropDownList ID="DropDownListNgonNgu" Width="80%" runat="server" EnableViewState="true" AutoPostBack="True"></asp:DropDownList></td>
        <td style="width: 20%"></td>
        <td style="width: 30%"></td>
    </tr>
    <tr>
        <td colspan="4">
            <h1><asp:Label ID="LabelBangTin" runat="server"></asp:Label>&nbsp;</h1><br />            
            <asp:GridView ID="GridViewTinTuc" runat="server"  BackColor="White" BorderColor="#51A5B8"
                BorderStyle="Solid" BorderWidth="1px" CellPadding="4" GridLines="Horizontal" AllowPaging="True" AllowSorting="True" Width="100%" AutoGenerateColumns="False" EmptyDataText="Chưa có tin nào !" DataKeyNames="Ma" HorizontalAlign="Center" OnPageIndexChanging="GridViewTinTuc_PageIndexChanging" OnSorting="GridViewTinTuc_Sorting" OnRowDeleting="GridViewTinTuc_RowDeleting" EnableViewState="False">
                <RowStyle BackColor="GhostWhite" ForeColor="#333333" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
                <FooterStyle BackColor="#51A5B8" ForeColor="#333333" HorizontalAlign="Center" VerticalAlign="Middle" />
                <PagerStyle BackColor="#51A5B8" ForeColor="WhiteSmoke" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" Wrap="False" Font-Overline="False" Font-Size="Smaller" Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" Wrap="True" />
                <HeaderStyle BackColor="#51A5B8" Font-Bold="True" ForeColor="White" />
                <Columns>
                    <asp:TemplateField ItemStyle-Width="40px"> 
                        <ItemTemplate>
                      	    <asp:Button ID="ButtonEdit" runat = "server" Text="Sửa" Width="38px" ForeColor="#0000C0" OnClick="ButtonEdit_Click" />
                        </ItemTemplate>
                        <EditItemTemplate>
                        </EditItemTemplate>
                        <ItemStyle BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ti&#234;u đề" SortExpression="TieuDe">
                        <ItemTemplate>
                            <asp:Label ID= "HyperLinkTieuDe" runat = "server" Text='<%#Common.FilterStringForColumn(Eval("TieuDe").ToString(),50)%>' />
                        </ItemTemplate>
                        <ItemStyle Wrap="True" BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="M&#244; tả" SortExpression="MoTa">
                        <ItemTemplate>
                            <asp:Label ID ="LabelMoTa" runat = "server" Text='<%#Common.FilterStringForColumn(Eval("MoTa").ToString(),100)%>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Wrap="True" BorderColor="LightGray" BorderStyle="Dotted" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ng&#224;y đăng" SortExpression="NgayDang">
                        <ItemTemplate>
                            <asp:Label ID="LabelNgayDang" runat="server" Text='<%#Eval("NgayDang","{0:dd/MM/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="View" SortExpression="LuotXem">
                        <ItemTemplate>
                            <asp:Label ID="LabelLuotXem" runat="server" Text='<%#Eval("LuotXem") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="80px">
                        <ItemTemplate>
                      	    <asp:Button ID="ButtonXoa" CssClass="art-button" runat="server" Text="Xóa" Width="38px" ForeColor="Red" OnClick="ButtonXoa_Click" />
                        </ItemTemplate>
                        <ItemStyle BorderColor="Silver" BorderStyle="Dotted" BorderWidth="1px" />
                        <EditItemTemplate>
                            <table>
                                <tr>
                                <td><asp:Button ID="ButtonDel" runat="server" ForeColor="Red" OnClick="ButtonDel_Click"
                                Text="Ok" Width="35px" /></td>
                                <td><asp:Button ID="ButtonNoDel" runat="server" ForeColor="Blue" OnClick="ButtonNoDel_Click"
                                Text="No" Width="35px" /></td>
                                </tr>
                            </table>
                        </EditItemTemplate>
                    </asp:TemplateField>
                </Columns>
                <EmptyDataRowStyle ForeColor="Red" />
                <AlternatingRowStyle BackColor="#C0D7DD" />
                <PagerSettings Mode="NumericFirstLast" PageButtonCount="3" />
                <EditRowStyle BackColor="#404040" BorderStyle="Solid" BorderWidth="1px"
                    ForeColor="White" />
            </asp:GridView>
            <br />
            <asp:Button ID="btnThemMoi" runat="server" Width="100px" Text="Thêm mới" OnClick="btnThemMoiClick" />
        </td>
    </tr>
</table>

</asp:Content>
